import { createRouter, createWebHashHistory } from "vue-router";

const routes = [
  // {
  //   path: "/",
  //   redirect: "/login",
  // },
  {
    path: "/login",
    name: "Login",
    component: () => import("@/views/Login/index.vue"),
  },

  {
    path: "/",
    name: "Layout",
    component: () => import("@/views/Layout/index.vue"),
    redirect: "/patientCard",
    children: [
      {
        path: "/patientCard",
        name: "PatientCard",
        component: () => import("@/views/PatientCard/index.vue"),
      },
      {
        path: "inspectionTesting",
        name: "InspectionTesting",
        component: () => import("@/views/inspectionTesting/index.vue"),
      },
      {
        path: "consultationApplyfor",
        name: "ConsultationApplyFor",
        component: () => import("@/views/consultationApplyfor/index.vue"),
      },
      {
        path: "surgicalMonitoring",
        name: "SurgicalMonitoring",
        component: () => import("@/views/SurgicalMonitoring/index.vue"),
      },
      {
        path: "systemSetting",
        name: "SystemSetting",
        redirect: "/basicConfiguration",

        component: () => import("@/views/SystemSetting/index.vue"),
        children: [
          {
            path: "/basicConfiguration",
            name: "BasicConfiguration",
            meta: { title: "基础配置", iconName: "BasicSetup" },
            component: () => import("@/views/BasicConfiguration/index.vue"),
          },
          {
            path: "/userManagement",
            name: "UserManagement",
            meta: { title: "用户管理", iconName: "Usericon" },
            component: () => import("@/views/UserManagement/index.vue"),
          },
          {
            path: "/roomManagement",
            name: "RoomManagement",
            meta: { title: "房间管理", iconName: "Roomicon" },
            component: () => import("@/views/RoomManagement/index.vue"),
          },
          {
            path: "/videoSourceManagement",
            name: "VideoSourceManagement",
            meta: { title: "视频源管理页面", iconName: "video1" },
            component: () => import("@/views/VideoSourceManagement/index.vue"),
          },
        ],
      },
      {
        path: "fileManagement",
        name: "FileManagement",
        redirect: "/videoRecording",

        component: () => import("@/views/FileManagement/index.vue"),
        children: [
          {
            path: "/videoRecording",
            name: "VideoRecording",
            meta: { title: "录像", iconName: "BasicSetup" },
            component: () => import("@/views/VideoRecording/index.vue"),
          },
          {
            path: "/captureImg",
            name: "CaptureImg",
            meta: { title: "截图", iconName: "Usericon" },
            component: () => import("@/views/CaptureImg/index.vue"),
          },

          // {
          //   path: "/videodemo",
          //   name: "videodemo",
          //   meta: { title: "播放demo", iconName: "Usericon" },
          //   component: () => import("@/views/videodemo/index.vue"),
          // },
        ],
      },

      {
        path: "/RequestConsultation",
        name: "RequestConsultation",
        component: () => import("@/views/RequestConsultation/index.vue"),
      },
      {
        path: "/InvitedConsultation",
        name: "InvitedConsultation",
        component: () => import("@/views/InvitedConsultation/index.vue"),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
